/*
 * Decompiled with CFR 0.150.
 * 
 * Could not load the following classes:
 *  cn.hutool.core.util.ObjectUtil
 *  de.felixroske.jfxsupport.FXMLController
 *  javafx.application.Platform
 *  javafx.collections.FXCollections
 *  javafx.collections.ObservableList
 *  javafx.event.ActionEvent
 *  javafx.fxml.FXML
 *  javafx.fxml.Initializable
 *  javafx.scene.control.Alert
 *  javafx.scene.control.Alert$AlertType
 *  javafx.scene.control.TableColumn
 *  javafx.scene.control.TableView
 *  javafx.scene.control.cell.PropertyValueFactory
 *  javafx.scene.layout.Pane
 *  javafx.stage.Modality
 *  javafx.util.Callback
 *  org.springframework.beans.factory.annotation.Autowired
 */
package com.gys.controller.addBox;

import cn.hutool.core.util.ObjectUtil;
import com.gys.GysApplication;
import com.gys.controller.BaseController;
import com.gys.controller.addBox.AddAddBoxController;
import com.gys.controller.addBox.AddPdAndExpController;
import com.gys.controller.dataManger.ControllerManger;
import com.gys.data.clearBox.GetClearQueryProductOutData;
import com.gys.view.addBox.AddPdAndExpView;
import de.felixroske.jfxsupport.FXMLController;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import java.util.Timer;
import java.util.TimerTask;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.Pane;
import javafx.stage.Modality;
import javafx.util.Callback;
import org.springframework.beans.factory.annotation.Autowired;

@FXMLController
public class AddProductQueryController
extends BaseController
implements Initializable {
    @FXML
    private Pane pane;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proBarcode;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proSpecs;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proForm;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proCode;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proRegisterNo;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proFactoryName;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> prcAmount;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proPlace;
    @FXML
    private TableView<GetClearQueryProductOutData> tableView;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> index;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proName;
    @FXML
    private TableColumn<GetClearQueryProductOutData, String> proPym;
    private ObservableList<GetClearQueryProductOutData> observableTableList = FXCollections.observableArrayList(new ArrayList());
    @Autowired
    private AddAddBoxController addAddBoxController;
    @Autowired
    private AddPdAndExpController addPdAndExpController;
    private GetClearQueryProductOutData product = null;

    public void initialize(URL location, ResourceBundle resources) {
        ControllerManger.controllerMap.put(this.getClass().getSimpleName(), this);
        this.index.setCellValueFactory((Callback)new PropertyValueFactory(this.index.getId()));
        this.proCode.setCellValueFactory((Callback)new PropertyValueFactory(this.proCode.getId()));
        this.proName.setCellValueFactory((Callback)new PropertyValueFactory(this.proName.getId()));
        this.prcAmount.setCellValueFactory((Callback)new PropertyValueFactory(this.prcAmount.getId()));
        this.proSpecs.setCellValueFactory((Callback)new PropertyValueFactory(this.proSpecs.getId()));
        this.proFactoryName.setCellValueFactory((Callback)new PropertyValueFactory(this.proFactoryName.getId()));
        this.proPlace.setCellValueFactory((Callback)new PropertyValueFactory(this.proPlace.getId()));
        this.proForm.setCellValueFactory((Callback)new PropertyValueFactory(this.proForm.getId()));
        this.proBarcode.setCellValueFactory((Callback)new PropertyValueFactory(this.proBarcode.getId()));
        this.proRegisterNo.setCellValueFactory((Callback)new PropertyValueFactory(this.proRegisterNo.getId()));
        this.proPym.setCellValueFactory((Callback)new PropertyValueFactory(this.proPym.getId()));
        this.init();
    }

    @Override
    public void init() {
        if (ObjectUtil.isEmpty(this.tableView)) {
            return;
        }
        this.product = null;
        List<GetClearQueryProductOutData> queryProductOutData = this.addAddBoxController.getQueryProductOutData();
        this.observableTableList = FXCollections.observableArrayList(queryProductOutData);
        this.tableView.setItems(this.observableTableList);
    }

    @FXML
    private void sureAction(ActionEvent event) {
        GetClearQueryProductOutData queryProductOutData = (GetClearQueryProductOutData)this.tableView.getSelectionModel().getSelectedItem();
        if (ObjectUtil.isEmpty(queryProductOutData)) {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u672a\u9009\u62e9\u5bf9\u5e94\u8bb0\u5f55\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\uff01");
            alert.showAndWait();
            return;
        }
        this.product = queryProductOutData;
        this.cancelAction();
        String proCompclass = queryProductOutData.getProCompclass();
        if (proCompclass.startsWith("A") || proCompclass.startsWith("B")) {
            this.addPdAndExpController.setProCodeParam(queryProductOutData.getProCode());
            this.addPdAndExpController.init();
            new Timer().schedule(new TimerTask(){

                @Override
                public void run() {
                    Platform.runLater((Runnable)new Runnable(){

                        @Override
                        public void run() {
                            GysApplication.showView(AddPdAndExpView.class, (Modality)Modality.APPLICATION_MODAL);
                        }
                    });
                }
            }, 500L);
        }
    }

    @FXML
    private void cancelAction() {
        this.pane.getScene().getWindow().hide();
    }

    public Pane getPane() {
        return this.pane;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProBarcode() {
        return this.proBarcode;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProSpecs() {
        return this.proSpecs;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProForm() {
        return this.proForm;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProCode() {
        return this.proCode;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProRegisterNo() {
        return this.proRegisterNo;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProFactoryName() {
        return this.proFactoryName;
    }

    public TableColumn<GetClearQueryProductOutData, String> getPrcAmount() {
        return this.prcAmount;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProPlace() {
        return this.proPlace;
    }

    public TableView<GetClearQueryProductOutData> getTableView() {
        return this.tableView;
    }

    public TableColumn<GetClearQueryProductOutData, String> getIndex() {
        return this.index;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProName() {
        return this.proName;
    }

    public TableColumn<GetClearQueryProductOutData, String> getProPym() {
        return this.proPym;
    }

    public ObservableList<GetClearQueryProductOutData> getObservableTableList() {
        return this.observableTableList;
    }

    public AddAddBoxController getAddAddBoxController() {
        return this.addAddBoxController;
    }

    public AddPdAndExpController getAddPdAndExpController() {
        return this.addPdAndExpController;
    }

    public GetClearQueryProductOutData getProduct() {
        return this.product;
    }

    public void setPane(Pane pane) {
        this.pane = pane;
    }

    public void setProBarcode(TableColumn<GetClearQueryProductOutData, String> proBarcode) {
        this.proBarcode = proBarcode;
    }

    public void setProSpecs(TableColumn<GetClearQueryProductOutData, String> proSpecs) {
        this.proSpecs = proSpecs;
    }

    public void setProForm(TableColumn<GetClearQueryProductOutData, String> proForm) {
        this.proForm = proForm;
    }

    public void setProCode(TableColumn<GetClearQueryProductOutData, String> proCode) {
        this.proCode = proCode;
    }

    public void setProRegisterNo(TableColumn<GetClearQueryProductOutData, String> proRegisterNo) {
        this.proRegisterNo = proRegisterNo;
    }

    public void setProFactoryName(TableColumn<GetClearQueryProductOutData, String> proFactoryName) {
        this.proFactoryName = proFactoryName;
    }

    public void setPrcAmount(TableColumn<GetClearQueryProductOutData, String> prcAmount) {
        this.prcAmount = prcAmount;
    }

    public void setProPlace(TableColumn<GetClearQueryProductOutData, String> proPlace) {
        this.proPlace = proPlace;
    }

    public void setTableView(TableView<GetClearQueryProductOutData> tableView) {
        this.tableView = tableView;
    }

    public void setIndex(TableColumn<GetClearQueryProductOutData, String> index) {
        this.index = index;
    }

    public void setProName(TableColumn<GetClearQueryProductOutData, String> proName) {
        this.proName = proName;
    }

    public void setProPym(TableColumn<GetClearQueryProductOutData, String> proPym) {
        this.proPym = proPym;
    }

    public void setObservableTableList(ObservableList<GetClearQueryProductOutData> observableTableList) {
        this.observableTableList = observableTableList;
    }

    public void setAddAddBoxController(AddAddBoxController addAddBoxController) {
        this.addAddBoxController = addAddBoxController;
    }

    public void setAddPdAndExpController(AddPdAndExpController addPdAndExpController) {
        this.addPdAndExpController = addPdAndExpController;
    }

    public void setProduct(GetClearQueryProductOutData product) {
        this.product = product;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof AddProductQueryController)) {
            return false;
        }
        AddProductQueryController other = (AddProductQueryController)o;
        if (!other.canEqual(this)) {
            return false;
        }
        Pane this$pane = this.getPane();
        Pane other$pane = other.getPane();
        if (this$pane == null ? other$pane != null : !this$pane.equals(other$pane)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proBarcode = this.getProBarcode();
        TableColumn<GetClearQueryProductOutData, String> other$proBarcode = other.getProBarcode();
        if (this$proBarcode == null ? other$proBarcode != null : !this$proBarcode.equals(other$proBarcode)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proSpecs = this.getProSpecs();
        TableColumn<GetClearQueryProductOutData, String> other$proSpecs = other.getProSpecs();
        if (this$proSpecs == null ? other$proSpecs != null : !this$proSpecs.equals(other$proSpecs)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proForm = this.getProForm();
        TableColumn<GetClearQueryProductOutData, String> other$proForm = other.getProForm();
        if (this$proForm == null ? other$proForm != null : !this$proForm.equals(other$proForm)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proCode = this.getProCode();
        TableColumn<GetClearQueryProductOutData, String> other$proCode = other.getProCode();
        if (this$proCode == null ? other$proCode != null : !this$proCode.equals(other$proCode)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proRegisterNo = this.getProRegisterNo();
        TableColumn<GetClearQueryProductOutData, String> other$proRegisterNo = other.getProRegisterNo();
        if (this$proRegisterNo == null ? other$proRegisterNo != null : !this$proRegisterNo.equals(other$proRegisterNo)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proFactoryName = this.getProFactoryName();
        TableColumn<GetClearQueryProductOutData, String> other$proFactoryName = other.getProFactoryName();
        if (this$proFactoryName == null ? other$proFactoryName != null : !this$proFactoryName.equals(other$proFactoryName)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$prcAmount = this.getPrcAmount();
        TableColumn<GetClearQueryProductOutData, String> other$prcAmount = other.getPrcAmount();
        if (this$prcAmount == null ? other$prcAmount != null : !this$prcAmount.equals(other$prcAmount)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proPlace = this.getProPlace();
        TableColumn<GetClearQueryProductOutData, String> other$proPlace = other.getProPlace();
        if (this$proPlace == null ? other$proPlace != null : !this$proPlace.equals(other$proPlace)) {
            return false;
        }
        TableView<GetClearQueryProductOutData> this$tableView = this.getTableView();
        TableView<GetClearQueryProductOutData> other$tableView = other.getTableView();
        if (this$tableView == null ? other$tableView != null : !this$tableView.equals(other$tableView)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$index = this.getIndex();
        TableColumn<GetClearQueryProductOutData, String> other$index = other.getIndex();
        if (this$index == null ? other$index != null : !this$index.equals(other$index)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proName = this.getProName();
        TableColumn<GetClearQueryProductOutData, String> other$proName = other.getProName();
        if (this$proName == null ? other$proName != null : !this$proName.equals(other$proName)) {
            return false;
        }
        TableColumn<GetClearQueryProductOutData, String> this$proPym = this.getProPym();
        TableColumn<GetClearQueryProductOutData, String> other$proPym = other.getProPym();
        if (this$proPym == null ? other$proPym != null : !this$proPym.equals(other$proPym)) {
            return false;
        }
        ObservableList<GetClearQueryProductOutData> this$observableTableList = this.getObservableTableList();
        ObservableList<GetClearQueryProductOutData> other$observableTableList = other.getObservableTableList();
        if (this$observableTableList == null ? other$observableTableList != null : !this$observableTableList.equals(other$observableTableList)) {
            return false;
        }
        AddAddBoxController this$addAddBoxController = this.getAddAddBoxController();
        AddAddBoxController other$addAddBoxController = other.getAddAddBoxController();
        if (this$addAddBoxController == null ? other$addAddBoxController != null : !(this$addAddBoxController).equals(other$addAddBoxController)) {
            return false;
        }
        AddPdAndExpController this$addPdAndExpController = this.getAddPdAndExpController();
        AddPdAndExpController other$addPdAndExpController = other.getAddPdAndExpController();
        if (this$addPdAndExpController == null ? other$addPdAndExpController != null : !(this$addPdAndExpController).equals(other$addPdAndExpController)) {
            return false;
        }
        GetClearQueryProductOutData this$product = this.getProduct();
        GetClearQueryProductOutData other$product = other.getProduct();
        return !(this$product == null ? other$product != null : !(this$product).equals(other$product));
    }

    protected boolean canEqual(Object other) {
        return other instanceof AddProductQueryController;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Pane $pane = this.getPane();
        result = result * 59 + ($pane == null ? 43 : $pane.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proBarcode = this.getProBarcode();
        result = result * 59 + ($proBarcode == null ? 43 : $proBarcode.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proSpecs = this.getProSpecs();
        result = result * 59 + ($proSpecs == null ? 43 : $proSpecs.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proForm = this.getProForm();
        result = result * 59 + ($proForm == null ? 43 : $proForm.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proCode = this.getProCode();
        result = result * 59 + ($proCode == null ? 43 : $proCode.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proRegisterNo = this.getProRegisterNo();
        result = result * 59 + ($proRegisterNo == null ? 43 : $proRegisterNo.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proFactoryName = this.getProFactoryName();
        result = result * 59 + ($proFactoryName == null ? 43 : $proFactoryName.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $prcAmount = this.getPrcAmount();
        result = result * 59 + ($prcAmount == null ? 43 : $prcAmount.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proPlace = this.getProPlace();
        result = result * 59 + ($proPlace == null ? 43 : $proPlace.hashCode());
        TableView<GetClearQueryProductOutData> $tableView = this.getTableView();
        result = result * 59 + ($tableView == null ? 43 : $tableView.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $index = this.getIndex();
        result = result * 59 + ($index == null ? 43 : $index.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proName = this.getProName();
        result = result * 59 + ($proName == null ? 43 : $proName.hashCode());
        TableColumn<GetClearQueryProductOutData, String> $proPym = this.getProPym();
        result = result * 59 + ($proPym == null ? 43 : $proPym.hashCode());
        ObservableList<GetClearQueryProductOutData> $observableTableList = this.getObservableTableList();
        result = result * 59 + ($observableTableList == null ? 43 : $observableTableList.hashCode());
        AddAddBoxController $addAddBoxController = this.getAddAddBoxController();
        result = result * 59 + ($addAddBoxController == null ? 43 : ($addAddBoxController).hashCode());
        AddPdAndExpController $addPdAndExpController = this.getAddPdAndExpController();
        result = result * 59 + ($addPdAndExpController == null ? 43 : ($addPdAndExpController).hashCode());
        GetClearQueryProductOutData $product = this.getProduct();
        result = result * 59 + ($product == null ? 43 : ($product).hashCode());
        return result;
    }

    public String toString() {
        return "AddProductQueryController(pane=" + this.getPane() + ", proBarcode=" + this.getProBarcode() + ", proSpecs=" + this.getProSpecs() + ", proForm=" + this.getProForm() + ", proCode=" + this.getProCode() + ", proRegisterNo=" + this.getProRegisterNo() + ", proFactoryName=" + this.getProFactoryName() + ", prcAmount=" + this.getPrcAmount() + ", proPlace=" + this.getProPlace() + ", tableView=" + this.getTableView() + ", index=" + this.getIndex() + ", proName=" + this.getProName() + ", proPym=" + this.getProPym() + ", observableTableList=" + this.getObservableTableList() + ", addAddBoxController=" + this.getAddAddBoxController() + ", addPdAndExpController=" + this.getAddPdAndExpController() + ", product=" + this.getProduct() + ")";
    }
}

